Permalink
...
Comparing changes
Open a pull request
- 2 commits
- 1 file changed
- 0 commit comments
- 1 contributor
Unified
Split
Showing
with
6 additions
and 6 deletions.
- +6 −6 scripts/apt.coffee
View
12
scripts/apt.coffee
| @@ -1,5 +1,5 @@ | ||
| module.exports = (bot) -> | ||
| - | ||
| + | ||
| bot.regexp /^.apt (.+)/, | ||
| ".apt <paket> -- Najde pakete po imenu na packages.ubuntu.com", | ||
| (match, r) -> | ||
| @@ -16,7 +16,7 @@ module.exports = (bot) -> | ||
| if archname.indexOf("-") == -1 | ||
| arches.push archname | ||
| paketi.push "#{$(paket).text().replace("Package ","")} {#{arches.join(", ")}}" | ||
| - cb paketi.reverse().slice(-10).join "\n" | ||
| + cb paketi.reverse().slice(-5).join "\n" | ||
| else | ||
| cb "Ne najdem" | ||
| @@ -27,15 +27,15 @@ module.exports = (bot) -> | ||
| ".aptf <ime_datoteke> -- Najde pakete po vsebini na packages.ubuntu.com", | ||
| (match, r) -> | ||
| aptf = (paket, cb)=> | ||
| - url = "http://packages.ubuntu.com/search?searchon=contents&keywords=#{encodeURI(paket)}&mode=exactfilename&suite=saucy&arch=any" | ||
| + url = "http://packages.ubuntu.com/search?searchon=contents&keywords=#{encodeURI(paket)}&mode=exactfilename&suite=xenial&arch=any" | ||
| bot.fetchHTML url , ($)-> | ||
| if $? | ||
| paketi = [] | ||
| - for paket in $("td.file") | ||
| + for paket in $("td.file") | ||
| paketi.push [$(paket).text().trim(), $(paket).next().text().trim()].join(" > ") | ||
| - cb paketi.reverse().slice(-10).join "\n" | ||
| + cb paketi.reverse().slice(-5).join "\n" | ||
| else | ||
| cb "Ne najdem" | ||
| aptf match[1].trim(), (answer)-> | ||
| - r.reply answer | ||
| + r.reply answer | ||